package com.example.jd;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.jd.common.InvokeResultUtil;
import com.example.jd.common.SequenceNumUtil;
import com.example.jd.finance.entity.MsCustomerRecords;
import com.example.jd.finance.sever.MsCustomerRecordsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * TODO
 *
 * @author daolai.fu
 * @desc
 * @Date 2021-11-06 14:06
 */

@RestController
@RequestMapping("/hello")
@Api(value = "你好，swagger")
public class HelloController {

    @Autowired
    private MsCustomerRecordsService msCustomerRecordsService;

    @Autowired
    private SequenceNumUtil sequenceNumUtil;


    @PostMapping("/test")
    @ApiModelProperty(value = "测试hello接口")
    @ApiImplicitParam(paramType="query", name = "blogName", value = "字段描述", required = true, dataType = "String",defaultValue = "daolai.fu")
    public String hello(@RequestParam String blogName){

        return "helloWorld" + blogName;
    }

    @GetMapping("/world")
    public InvokeResultUtil<Object> test(){
        MsCustomerRecords one = msCustomerRecordsService.findOne();
        String orderNum = null;
        if (one != null){
            orderNum = one.getOrderNum();
        }
        return InvokeResultUtil.success("成功:" + orderNum);
    }

    @GetMapping("/testNginx")
    public InvokeResultUtil<Object> testd(){

        return InvokeResultUtil.success("成功testNginx:");
    }


}
